#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/wait.h>

int pipefd2[2];

int max_depth = 3;
int cur_depth=1;
char ch_data[] = "abc";

void func()
{
    pid_t cpid;
    char buf;
    if(cur_depth==1)
    {
        if (pipe(pipefd2) == -1) {
            perror("pipe");
            exit(EXIT_FAILURE);
        }
        cpid = fork();
        if (cpid == -1) {
            perror("fork");
            exit(EXIT_FAILURE);
        }

        if (cpid == 0) 
        {    
            ++cur_depth;
        } 
        else 
        {
            
        }
    }
    else if(cur_depth==2)
    {

    }
}


int main(int argc, char *argv[])
{
   func();
   return 0;
}